package com.suixun.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.suixun.controller.handle.SessionHandle;

/**
 * 功能描述: 添加mvc拦截器
 * 
 * @author jacky
 * @date 2018年1月10日上午9:21:03
 */
@Configuration
@EnableRedisHttpSession(maxInactiveIntervalInSeconds = 43200) // session有效期为0.5天
public class SessionConfig extends WebMvcConfigurerAdapter {

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(new SessionHandle()).addPathPatterns("/**").excludePathPatterns("/operator/login");// 登录不做拦截
	}
}
